package com.jshoperxms.controller.utils.enums;

public class CartEnums {
	/**
	 * 商品在购物车中的状态
	 * 
	 * @author sdywcd
	 *
	 */
	public enum CartStatus {
		NEWADDTOCART_BACKSTAGE_ZERO_NUM("从后台加入购物车的商品", "0"), NEWADDTOCART_ONE_NUM(
				"新加入购物车的商品", "1"), HAVE_DELETETOCART_TWO_NUM("从购物车中删除的商品", "2"), HAVE_RPTOORDER_THREE_NUM(
				"被加入订单的商品", "3");
		private String name;
		private String state;

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getState() {
			return state;
		}

		public void setState(String state) {
			this.state = state;
		}

		private CartStatus(String name, String state) {
			this.name = name;
			this.state = state;
		}

		public static String getName(String tag) {
			for (CartStatus d : CartStatus.values()) {
				if (d.getState().equals(tag)) {
					return d.getName();
				}
			}
			return "";
		}
	}


	/**
	 * 商品加入购物车行为标记
	 */
	public  enum CartActionTag{
		ADDTOCART_ZERO_NUM("加入购物车","0"),BUYNOW_ONE_NUM("直接购买","1"),FLASHBUY_TWO_NUM("闪购","2"),SPECIAL_THREE_NUM("商品专题","3"),ALBUM_FOUR_NUM("专辑商品","4"),
		SECKILL_FIVE_NUM("秒杀","5"),GROUPBUY_SIX_NUM("团购","6"),ADVBUY_SEVEN_NUM("广告位购买","7"),SYSSEND_EIGHT_NUM("系统赠送","8");
		private String name;
		private String state;

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getState() {
			return state;
		}

		public void setState(String state) {
			this.state = state;
		}

		private CartActionTag(String name, String state) {
			this.name = name;
			this.state = state;
		}

		public static String getName(String tag) {
			for (CartActionTag d : CartActionTag.values()) {
				if (d.getState().equals(tag)) {
					return d.getName();
				}
			}
			return "";
		}
	}




	/**
	 * 促销加入购物车行为标记
	 */
	public  enum PromotionComeTag{
		ADDTOCART_ZERO_NUM("加入购物车","0"),BUYNOW_ONE_NUM("直接购买","1"),FLASHBUY_TWO_NUM("闪购","2"),SPECIAL_THREE_NUM("商品专题","3"),ALBUM_FOUR_NUM("专辑商品","4"),
		SECKILL_FIVE_NUM("秒杀","5"),GROUPBUY_SIX_NUM("团购","6"),ADVBUY_SEVEN_NUM("广告位购买","7"),SYSSEND_EIGHT_NUM("系统赠送","8");
		private String name;
		private String state;

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getState() {
			return state;
		}

		public void setState(String state) {
			this.state = state;
		}

		private PromotionComeTag(String name, String state) {
			this.name = name;
			this.state = state;
		}

		public static String getName(String tag) {
			for (PromotionComeTag d : PromotionComeTag.values()) {
				if (d.getState().equals(tag)) {
					return d.getName();
				}
			}
			return "";
		}
	}


	public enum IsMall {
		SELF("自营", "1"), STORE("店铺", "2");
		private String name;
		private String state;

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getState() {
			return state;
		}

		public void setState(String state) {
			this.state = state;
		}

		private IsMall(String name, String state) {
			this.name = name;
			this.state = state;
		}

		public static String getName(String tag) {
			for (IsMall d : IsMall.values()) {
				if (d.getState().equals(tag)) {
					return d.getName();
				}
			}
			return "";
		}
	}

	public enum IsWishList {
		YES("加入心愿单", "1"), NO("未加入心愿单", "2");
		private String name;
		private String state;

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getState() {
			return state;
		}

		public void setState(String state) {
			this.state = state;
		}

		private IsWishList(String name, String state) {
			this.name = name;
			this.state = state;
		}

		public static String getName(String tag) {
			for (IsWishList d : IsWishList.values()) {
				if (d.getState().equals(tag)) {
					return d.getName();
				}
			}
			return "";
		}
	}
	/**
	 * 购物车库存状态
	 * @author sdywcd
	 *
	 */
	public enum CartStockStatus {
		YES("有货", "1"), NO("缺货", "0");
		private String name;
		private String state;

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getState() {
			return state;
		}

		public void setState(String state) {
			this.state = state;
		}

		private CartStockStatus(String name, String state) {
			this.name = name;
			this.state = state;
		}

		public static String getName(String tag) {
			for (CartStockStatus d : CartStockStatus.values()) {
				if (d.getState().equals(tag)) {
					return d.getName();
				}
			}
			return "";
		}
	}

}
